package site.marqstree.kotlin.library.base.ui.widget.recyclerview

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import site.marqstree.kotlin.library.base.common.AppManager
import site.marqstree.kotlin.library.base.ui.R
import site.marqstree.kotlin.library.base.util.GlideUtil


/*
 * 项目名: KotlinMall
 * 包名: site.marqstree.kotlin.library.base.ui.widget.recyclerview
 * 文件名: ImageAdapter
 * 创建者: marqstree
 * 创建时间: 2020/3/14 16:44
 * 描述: 单图recyclerview适配器
 */
class ImageAdapter(images: MutableList<String>)
    : BaseQuickAdapter<String,BaseViewHolder>(R.layout.item_recycler_image ,images) {
    override fun convert(helper: BaseViewHolder, item: String) {
        val mImg = helper.getView<ImageView>(R.id.mImg)
        GlideUtil.loadImage(AppManager.instance.currentActivity(),
                            item,
                            mImg)
    }
}